package com.kingmed.kmss.admin.modules.ums.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.kingmed.kmss.admin.modules.ums.model.UmsRole;
import com.kingmed.kmss.common.dto.admin.ums.AdminDTO;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 后台用户角色表 Mapper 接口
 * </p>
 */
public interface UmsRoleMapper extends BaseMapper<UmsRole> {

    @Select(" select ua.* from ums_admin_role_relation uarr left join ums_admin ua on ua.id=uarr.admin_id " +
            " where ua.delete_flag=0 and uarr.delete_flag=0 and uarr.role_id=#{roleId} ")
    List<AdminDTO> listUserInRole(Long roleId);
}
